#include <QtCore/QCoreApplication>
#include "vlcontroller.h"

VLController* vlController;

void onMouse(int event, int x, int y, int flags, void* param);

int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);

    vlController  = new VLController();
    cvSetMouseCallback(MAIN_WINDOW_NAME_VL, onMouse,NULL);
    vlController->run();

    delete vlController;
    return a.exec();
}

void onMouse(int event, int x, int y, int flags, void *param)
{
    switch( event ) {
    case CV_EVENT_LBUTTONDOWN:
        vlController->ROI_add_point(cvPoint(x,y));
        break;

    case CV_EVENT_RBUTTONDOWN:
         vlController->ROI_apply();
        break;

    }
}
